package com.bawei.module_mine.state

import com.bawei.lib_common.mvi.IState
import com.bawei.module_mine.model.entity.UserEntity
import kotlin.random.Random

sealed class QuickLoginState : IState {
    // 初始化状态
    object QuickLoginInit : QuickLoginState()
    
    // 获取手机号成功
    data class PhoneNumberSuccess(val phoneNumber: String) : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
    
    // 获取手机号失败
    data class PhoneNumberFailed(val message: String) : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
    
    // 一键登录成功
    data class OneKeyLoginSuccess(val result: UserEntity) : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
    
    // 一键登录失败
    data class OneKeyLoginFailed(val message: String) : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
    
    // 认证服务检查结果
    data class AuthServiceResult(val isAvailable: Boolean, val message: String) : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
    
    // 加载状态
    data class Loading(val message: String = "处理中...") : QuickLoginState() {
        override fun equals(other: Any?): Boolean = false
        override fun hashCode(): Int = Random.nextInt()
    }
} 